package thread;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Author:  LiuTao
 * Version: 1.0
 * Date:    2023-11-22  21:44
 */
public class ThreadDemo7 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(() -> {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });
        System.out.println("start执行前：" + t.isAlive());
        t.start();
        System.out.println("start执行后：" + t.isAlive());
        Thread.sleep(2000);
        System.out.println("run执行之后：" + t.isAlive());
    }
}
